<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    <!-- 引入bootstrap样式文件 -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <title>轮播图效果</title>
    <script src="bootstrap/js/jquery-3.5.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <style>
      .box{
        width: 800px;
        height: 300px;
        background-color: paleturquoise;
        margin: 100px auto;
      }
      .carousel,
      .carousel img {
        width: 100%;
        height: 300px!important;
        
      }
    </style>
</head>
<body>
    <div class="box">
      <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators 小圆点-->
        <ol class="carousel-indicators">
          <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
          <li data-target="#carousel-example-generic" data-slide-to="1"></li>
          <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>
      
        <!-- Wrapper for slides 轮播图片-->
        <div class="carousel-inner" role="listbox">
          <div class="item active">
            <img src="img/index_topcarousel_01.JPG" alt="...">
            <div class="carousel-caption">
              这是第一张图
            </div>
          </div>
          <div class="item">
            <img src="img/index_topcarousel_02.JPG" alt="...">
            <div class="carousel-caption">
              这是第二张图
            </div>
          </div>
          <div class="item">
            <img src="img/index_topcarousel_03.JPG" alt="...">
            <div class="carousel-caption">
              这是第三张图
            </div>
          </div>
          这是一个轮播图
        </div>
      
        <!-- Controls 左右箭头-->
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
          <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
          <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
          <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
          <span class="sr-only">Next</span>
        </a>
      </div>
    </div>
</body>
<script>
  $('.carousel').carousel({
  interval: 2000
})
</script>
</html>